package com.shop.service.impl;

import java.util.HashMap;
import java.util.Map;

import com.shop.bean.Admin;
import com.shop.dao.AdminDao;
import com.shop.dao.impl.AdminDaoImpl;
import com.shop.service.AdminService;

public class AdminServiceImpl implements AdminService {

	AdminDao ad=new AdminDaoImpl();
	@Override
	public Map<String, Object> login(Admin admin) {
		Map<String, Object> map=new HashMap();
		Admin isad=ad.selectAdmin(admin.getAccount(),admin.getPassword());
		if(isad!=null) {
			map.put("loginAdmin", isad);
		}else {
			if(ad.selectAdminByAccount(admin.getAccount())!=null) {
				map.put("msg", "密码错误");
			}else {
				map.put("msg", "用户名不存在");
			}
		}
		return map;
	}

}
